<?php
/**
 * Created by PhpStorm.
 * User: Jiarui
 * Date: 2015/10/11
 * Time: 0:57
 */

namespace Admin\Controller;
use Think\Controller;

class OurController extends BaseController {

    public function _initialize(){
        parent::_initialize();
    }

    public function listPage(){

        $model = D('InfoUs');

        $data = $model->getInfo();

        $temp = htmlspecialchars_decode($data['info']);

        $this->assign('text',$temp);

        $this->display();

    }

    public function saveOur(){

        $text = I('post.text',null);

        $model = D('InfoUs');

        $result = $model->saveOur($text);

        if($result) {
            $this->ajaxReturn('success');
        }else{
            $this->ajaxReturn('fail');
        }

    }

    public function getOur(){

        $model = D('InfoUs');

        $data = $model->getInfo();

        $temp = htmlspecialchars_decode($data['info']);

        $this->ajaxReturn($temp);

    }

}